layui.use(['ax','admin','form','upload'], function () {
    var $ = layui.$;
    var $ax = layui.ax;
    var admin = layui.admin;
    var form = layui.form;
    var upload = layui.upload;

    //拖拽上传
    upload.render({
        elem: '#import'
        ,url: Feng.ctxPath + '/score/import' //改成您自己的上传接口
        ,accept: 'file' //普通文件
        ,exts: 'zip' //只允许上传压缩文件
        ,data:{'path':'score'}
        ,done: function(res){
            Feng.success("导入成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
        }
    });


    form.on("submit(btnSubmit)",function (data) {
        var ajax = new $ax(Feng.ctxPath + "/deal/import", function (data) {
            Feng.success("复制成功，请选择目标年度查看！");

            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);

            //关掉对话框
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("复制失败！" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
    })
})